﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _24_virtual_override
{
    class Program
    {
        static void Main(string[] args)
        {
            Animal p = new Dog();
            p.Bork();
            Console.ReadKey();
        }
    }

    //抽象类
    public abstract class Animal
    {
        public Animal()
        {

        }

        public abstract void Bork();
    }

    public class Dog : Animal
    {

        public override void Bork()
        {
            Console.WriteLine("wangwangwang");
        }
    }

    public class Cat : Animal
    {
        public override void Bork()
        {
            Console.WriteLine("miaomiaomiao");
        }
    }
}
